package com.jadcon.bedbreakfast.domain;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springmodules.validation.bean.conf.loader.annotation.handler.Email;
import org.springmodules.validation.bean.conf.loader.annotation.handler.Length;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
import org.springmodules.validation.bean.conf.loader.annotation.handler.Range;

public class Customer {

	private int id;
	@NotBlank
	private String username;
	@NotBlank
	private String password;
	@NotBlank
	private String name;
	private String name2;
	@NotBlank
	private String address1;
	private String address2;
	@NotBlank
	private String city;
	@NotBlank
	@Length(min = 2, max = 2)
	private String state;
	@Range(min = 1, max = 99999)
	private int zip;
	@NotBlank
	@Email
	private String email;
	private List<PhoneNumber> phoneNumberList = new ArrayList<PhoneNumber>();

	public Customer() {
	}

	public Customer(int id,  String username, String password, String name, String name2,
			String address1, String address2, String city, String state,
			int zip, String email) {
		this.id = id;
		this.username = username;
		this.password = password;
		this.name = name;
		this.name2 = name2;
		this.address1 = address1;
		this.address2 = address2;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.email = email;
	}
	
	public Customer(String username, String password, String name, String name2,
			String address1, String address2, String city, String state,
			int zip, String email) {
		this.username = username;
		this.password = password;
		this.name = name;
		this.name2 = name2;
		this.address1 = address1;
		this.address2 = address2;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.email = email;
	}
	
	public Customer(String name, String name2,
			String address1, String address2, String city, String state,
			int zip, String email) {
		this.name = name;
		this.name2 = name2;
		this.address1 = address1;
		this.address2 = address2;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.email = email;
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

	public void addPhoneNumber(PhoneNumber phoneNumber) {
		phoneNumberList.add(phoneNumber);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName2() {
		return name2;
	}

	public void setName2(String name2) {
		this.name2 = name2;
	}

	public String getAddress1() {
		return address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getAddress2() {
		return address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public int getZip() {
		return zip;
	}

	public void setZip(int zip) {
		this.zip = zip;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public List<PhoneNumber> getPhoneNumberList() {
		return phoneNumberList;
	}

	public void setPhoneNumberList(List<PhoneNumber> phoneNumberList) {
		this.phoneNumberList = phoneNumberList;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
